package demo.day11_CollectionAddpackage;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/8/3-08-03-9:34
 * @Description：demo.day11_CollectionAddpackage
 */
public class Collections_learn {
    public static void main(String[] args) {
        List list = new ArrayList<>(Arrays.asList(12,34,24,1));    //快速向集合中添加元素
        Collections.addAll(list,13,2,422,1);
        System.out.println(list);

        Collections.reverse(list);    //翻转集合中元素顺序
        System.out.println(list);

        Collections.shuffle(list);     //打乱集合元素顺序
        System.out.println(list);

        System.out.println(Collections.max(list));    //获取集合中最大的元素
        System.out.println(Collections.min(list));     //获取集合中最小元素
    }
}
